package com.xuce.nzshopuserweb.controller;

import com.xuce.dto.ResultBean;
import com.xuce.nzshopuserweb.client.UserServiceClient;
import com.xuce.pojo.TUser;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 徐策
 * @date 2020/3/11 16:36
 */

@Controller
@RequestMapping("user")
public class UserController {
    private static final String REST_URL_PREFIX = "http://user-service";

    @Resource
    UserServiceClient userServiceClient;

//    @RequestMapping("register/email/{addr}/{password}")
    @PostMapping("register/email")
    @ResponseBody
    public ResultBean registerByEmail(TUser user){
        return userServiceClient.registerByEmail(user);
    }
    @RequestMapping("register")
    public ResultBean register(@RequestParam String uname, @RequestParam String password) {
        return userServiceClient.register(uname,password);
    }

    //login
}
